home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 50
/
Aminet 50 (2002)(GTI - Schatztruhe)[!][Aug 2002].iso
/
Aminet
/
util
/
wb
/
BWS_Scalos.lha
/
BWS_Scalos
/
Scalos_Rename
/
other.e
< prev
next >
Wrap
Text File
|
2001-12-05
|
2KB
|
88 lines
OPT MODULE
OPT EXPORT
OPT PREPROCESS
MODULE '*loc','*locnums','dos/dos','dos/dosextens','muimaster','libraries/mui'
ENUM ERR_NONE, ERR_ASL, ERR_KICK
RAISE ERR_ASL IF Mui_AllocAslRequest()=NIL,ERR_KICK IF KickVersion()=FALSE
OBJECT lvo; typ,nam,pth,ful;ENDOBJECT
ENUM ID_HELP=2,ID_ABOUT,ID_ABOUTMUI
PROC cmp1Func(s1:PTR TO lvo,s2:PTR TO lvo) IS OstrCmp(s2.ful,s1.ful)
PROC icon(n); DEF s;s:=String(StrLen(n)+5); StringF(s,'\s.info',n); ENDPROC s
PROC news(s); DEF ns; ns:=String(StrLen(s)); StrCopy(ns,s); ENDPROC ns
PROC nStrCmp(o,n,l=-1); DEF ou[256]:STRING,nu[256]:STRING;
StrCopy(ou,o); UpperStr(ou)
StrCopy(nu,n); UpperStr(nu)
ENDPROC StrCmp(ou,nu,l)
PROC writebd(b,l:PTR TO LONG,n); DEF a,c,o
IF c:=Open(b,NEWFILE)
o:=SetStdOut(c)
FOR a:=0 TO n-1 DO WriteF('\s\n',l[a])
SetStdOut(o)
Close(c)
ENDIF
ENDPROC
PROC devname(path); DEF dn,p
p:=InStr(path,':')
dn:=String(p+1)
StrCopy(dn,path,p+1)
ENDPROC dn
PROC volExists(vol,type="V") HANDLE;
DEF dlock=0,dl:doslist,v,s[256]:STRING,pars,t1;
v:=news(vol); UpperStr(v);
IF v[StrLen(v)-1]=":" THEN v[StrLen(v)-1]:=0
SELECT type
CASE "V"; t1:=LDF_VOLUMES
CASE "A"; t1:=LDF_ASSIGNS
CASE "D"; t1:=LDF_DEVICES
ENDSELECT
pars:=t1 OR LDF_READ;
dl:=(dlock:=LockDosList(pars));
WHILE dl:=NextDosEntry(dl,pars);
StrCopy(s,BADDR(dl.name)+1);
UpperStr(s)
IF StrCmp(s,v) THEN Raise(-1)
ENDWHILE;
EXCEPT DO
IF dlock THEN UnLockDosList(pars)
ENDPROC exception
PROC bump(name:PTR TO CHAR, deft,app,win,lo); DEF c,bump,str[256]:STRING
bump:=String(StrLen(name)+10)
c:=1
StringF(bump,'\s.\d',name,c++)
IF FileLength(bump)<>-1
WHILE FileLength(bump)<>-1 DO StringF(bump,'\s.\d',name,c++)
ENDIF
StringF(str,'\s !\n\s\n\n\s',locs(lo,MSG_FileExists),name,locs(lo,MSG_FileExOpts))
c:=muireq(deft,str,locs(lo,GAD_FileExOpts),app,win)
IF c=1; StringF(str,'c:Delete <>nil: "\s" all',name); Execute(str,0,0)
ELSEIF c=2; StringF(name,'\s',bump)
ELSEIF c=3; RETURN -6
ELSE; RETURN -1
ENDIF
ENDPROC 0
PROC muireq(title=0,body=0,gads=0,app=0,win=0,args=0)
DEF answer
answer:=Mui_RequestA(app,win,0,title,gads,body,args)
ENDPROC answer
PROC makemc(mp:PTR TO mui_command,m:PTR TO mui_command)
mp.mc_name:=m.mc_name
mp.mc_template:=m.mc_template
mp.mc_parameters:=m.mc_parameters
mp.mc_hook:=m.mc_hook
ENDPROC